package simple_factory

type Pay interface {
	Pay() string
}

type AliPay struct{}

func (AliPay) Pay() string {
	return "支付宝支付"
}

type WechatPay struct{}

func (WechatPay) Pay() string {
	return "微信支付"
}

type ApplePay struct{}

func (ApplePay) Pay() string {
	return "苹果支付"
}

func NewPay(typ int) Pay {
	switch typ {
	case 1:
		return AliPay{}
	case 2:
		return WechatPay{}
	case 3:
		return ApplePay{}
	default:
		return AliPay{}
	}
}
